# $Id$
# Maintainer: Anatol Pomozov
# Contributor: Frederic Bezies <fredbezies at gmail dot com>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - old dtc for old U-Boot

pkgname=dtc145
pkgver=1.4.5
pkgrel=3
pkgdesc='Device Tree Compiler 1.4.5'
url='http://www.devicetree.org/Device_Tree_Compiler'
arch=(x86_64)
license=(GPL2)
makedepends=(swig python2)
provides=(dtc)
conflicts=(dtc)
source=(https://www.kernel.org/pub/software/utils/dtc/dtc-$pkgver.tar.xz)
sha256sums=('042c7164806af34069d13ede59d85b8156d09f179f721c516dc37712d3a0f621')

prepare() {
  cd dtc-$pkgver
  sed -i 's/-Werror//' Makefile
  sed -i 's/python\b/python2/' tests/run_tests.sh
}

build() {
  cd dtc-$pkgver
  make
}

check() {
  cd dtc-$pkgver
  make check
}

package() {
  cd dtc-$pkgver
  make DESTDIR="$pkgdir" SETUP_PREFIX="$pkgdir/usr" PREFIX=/usr install
}

